<template>
  <div class="cart">
      <h2>购物车组件</h2>
      <p>{{id}}_{{nName}}_{{nPrice}}</p>
  </div>
</template>

<script>
export default {
    name:"Cart",
    data(){
        return {
            id:'',
            nName:'',
            nPrice:''
        }
    },
    created(){
        // console.log(this.$route.query);
        let { id,pName,pPrice }=this.$route.query;
        // console.log(id,pName,pPrice)
        this.id=id;
        this.nName=pName;
        this.nPrice=pPrice; 
    }
}
</script>

<style scoped>
    .cart{
        width: 100%;
        height: 70%;
        background-color: rgb(148, 96, 244);
    }
</style>